import { defineStore } from 'pinia'
import { userType } from './types'

export const useUserStore = defineStore({
    id: 'user', // 唯一key
    state: (): userType => {
        return {
            token: '',
            name: '',
        }
    },
    actions: {
        SET_TOKEN(token: string) {
            this.token = token
        },
        SET_NAME(name: string | undefined) {
            this.name = name
        },
    },
})
